<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <meta name="ctx" th:content="${#httpServletRequest.getContextPath()}"/>
    <title>节目操作日志</title>
    <link rel="stylesheet" th:href="@{/css/admin/base-v2.css}">
    <link rel="stylesheet" th:href="@{/lib/font-awesome/4.7.0/css/font-awesome.min.css}">
    <link rel="stylesheet" th:href="@{/css/admin/app.css}">
</head>

<body>

<div class="app-page">

    <div class="app-page-content">
        <div class="app-card">
            <div class="app-card-body">
                <div class="app-card-body-con">

                    <table class="z-table">
                        <thead>
                        <th>操作人</th>
                        <th>操作时间</th>
                        <th>操作项目</th>
                        </thead>
                        <tbody>

                        <tr th:each="log: ${result}">
                            <td th:text="${log.userName}"></td>
                            <td th:text="${log.addTime}"></td>
                            <td th:text="${log.operationType}"></td>
                        </tr>
                        </tbody>
                    </table>

                    <!-- 分页 -->
                    <div class="clearfix">
                        <div class="pagination z-pat z-fr"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>

</div>

<script th:src="@{/lib/jquery.min.js}"></script>
<script th:src="@{/js/pagination.js}"></script>
<script>
    var context = $("meta[name='ctx']").attr("content") || '';
    var pageNum = [[${pageNum}]];
    var pageSize = [[${pageSize}]];
    var total = [[${total}]];
    var programVersion = '[[${programVersion}]]';

    var pagination = new Pagination(".pagination", {
        pageIndex: pageNum, // 当前页数
        pageSize: pageSize, // 每页数量
        count: total, // 总条数
        maxButtonCount: 5, // 分页按钮数量(可选)
        // 分页切换事件
        onPageChanged: function (pageIndex) {
            var url = context + '/programLog/listByPage';
            if (isBlank(programVersion)) {
                url += '?programVersion=' + programVersion;
            }
            window.location.href = url;
        }
    })

    function isParamOk(param) {
        if (null == param) {
            return false;
        }
        if ('' === param) {
            return false;
        }
        if (undefined === param) {
            return false;
        }
        return true;
    }
</script>
</body>

</html>